package com.jfm.jfmm.collector.entity.collect.result;

import com.jfm.jfmm.collector.entity.collect.Result;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author DYang
 * @since 2024-10-11 22:53
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class UDPResult extends Result {

    /**
     * 目标地址
     */
    private String host;

    /**
     * 目标端口
     */
    private Integer port;

    /**
     * 返回值 1: 成功 0: 失败
     */
    private int result;

    /**
     * 延迟(ms)
     */
    private long delay;

    public static UDPResult build() {
        return new UDPResult();
    }

    public UDPResult delay(long delay) {
        this.delay = delay;
        return this;
    }

    public UDPResult host(String host) {
        this.host = host;
        return this;
    }

    public UDPResult port(Integer port) {
        this.port = port;
        return this;
    }

    public UDPResult result(int result) {
        this.result = result;
        return this;
    }

}
